import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Solution1 {
    public int[] twoSum(int[] nums, int target) {
        Map<Integer,Integer> hashable = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            if(hashable.containsKey(target - nums[i])){
                return new int[]{hashable.get(target - nums[i]),i};
            }
            hashable.put(nums[i],i);
        }
        return new int[0];
    }
}
